package com.dcy.adapter.objectadapter;

/**
 * @Author：dcy
 * @Description: 适配器
 * @Date: 2021/1/21 9:21
 */
public class VoltageAdapter implements IVoltage5V {

    private Voltage220V voltage220V;

    public VoltageAdapter(Voltage220V voltage220V) {
        this.voltage220V = voltage220V;
    }

    @Override
    public int output5V() {
        int srcV = this.voltage220V.output220V();
        int dst = srcV / 44; // 转成5V
        return dst;
    }

}
